import { createSlice, type PayloadAction } from "@reduxjs/toolkit";
import type { Type } from "../api/type/typeType";

const typeSlice = createSlice({
    name:"type",
    initialState:{
        typeList: [] as Type[]
    },
    reducers:{
        setTypeList(state,action:PayloadAction<Type[]>){
            return {
                ...state,
                typeList:action.payload
            }
        }
    }
})
export const {setTypeList} = typeSlice.actions
export const typeReducer = typeSlice.reducer;